script_enemy_main
{
        let csd     = GetCurrentScriptDirectory;
	let speed = GetSpeed;
	let angle = GetAngle;
	let num = GetArgument;
	let imgEnemy;
	imgEnemy=csd~"..\lib\fairy_red.png";


	let SelectedDifficult=GetCommonDataDefault("SELECTEDDIFFICULT","Normal");
	let ZakoMagicCircleScale=0.00;

    @Initialize {
        SetLife(20);
        SetDamageRate(100,100);
	SetTexture(imgEnemy);
	Initialize_Fairy(0);
	SetGraphicScale(0,0);
	Tmain;
	}

    @MainLoop {
	
	yield;
    }

        @DrawLoop {
		SetColor(ZakoColor[0],ZakoColor[1],ZakoColor[2]);
		DrawFairy(imgEnemy);
		DrawMagicCircle("WHITE",ZakoMagicCircleScale);
	}

        @Finalize
        {
		MagicCircleBreak(GetX,GetY,1,0.2);
		FinalizeItemAndShotnum(1);
        } 

task Tmain
{
yield;
OutDamageRateZero;
AutoErazeTime(900);
GetDamege;
MagicColor;
move;
AppearEffect;
Collision;

alternative(GetCommonDataDefault("SELECTEDDIFFICULT","None"))
case("Moderate")
{
shotM;
}
case("Extream")
{
shotE;
}
case("Apocalypse")
{
shotA;
}

}

task Collision
{
	wait(20);
	loop
	{
		SetGroundCollision(GetX,GetY,24);
		yield;
	}
}

task AppearEffect
{
	ascent(i in 0..20)
	{
		SetGraphicScale(i/20,i/20);
		ZakoMagicCircleScale+=0.2/20;
		yield;
	}
}

task move
{
	SetSpeed(GetSpeed);
	SetAngle(GetAngle);
}

task shotM
{
wait(45);
loop(3)
{
GroundCreateShot01(GetX,GetY,3.5,GetAngleToPlayer,9,5);
wait(120);
}
}
////////////////////////////////////////////////////////
task shotE
{
wait(45);
loop(10)
{
GroundCreateShot01(GetX,GetY,3.5,GetAngleToPlayer,9,5);
wait(30);
}
}
////////////////////////////////////////////////////////
task shotA
{
wait(45);
loop(10)
{
ascent(let i in 0..3)
{
GroundCreateShot01(GetX,GetY,4.0+i*0.25,GetAngleToPlayer,9,5);
}
wait(24);
}
}

#include_function ".\..\txt/StageEnemydata.txt"
#include_function ".\..\lib\lib_anime_fairy.txt"
}

#include_script ".\..\txt/EnemyShotData.txt"